package com.TeacherInfoServer.converter;

import org.springframework.stereotype.Component;

@Component
public class WhetherConverter {

    public Integer convertToJavaData(String value) {
        return switch (value) {
            case "否" -> 0;
            case "是" -> 1;
            default -> null;
        };
    }

    public String convertToExcelData(Integer value) {
        return switch (value) {
            case 0 -> "否";
            case 1 -> "是";
            default -> null;
        };
    }
}
